﻿#Events for children developing personality traits

namespace = child_personality_ua

#vengeful, chaste or stubborn
#Child is rejected by a crush
child_personality_ua.0006 = {
	type = character_event
	title = child_personality.0006.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:crush
				}
				desc = child_personality.0006.desc_crush
			}
			desc = child_personality.0006.desc
		}
	}
	theme = education
	override_icon = {
		reference = "gfx/interface/icons/event_types/type_relation_unfriendly.dds"
	}
	
	override_background = {
		reference = corridor_day
	}
	left_portrait = {
		character = root
		animation = sadness
	}
	right_portrait = {
		character = scope:crush
		animation = dismissal
	}

	trigger = {
		is_available_child_allow_travel = yes
		age >= 10 #Because chaste/lustful are only given at age 13
		NOT = {
			has_sexuality = none
		}
		NAND = {
			OR = {
				has_trait = vengeful
				has_trait = forgiving
			}
			OR = {
				has_trait = chaste
				has_trait = lustful
			}
			OR = {
				has_trait = stubborn
				has_trait = fickle
			}
		}
	}

	weight_multiplier = {
		base = 1

		modifier = {
			add = 2
			any_relation = {
				type = guardian
				OR = {
					has_trait = vengeful
					has_trait = chaste
					has_trait = stubborn
				}
			}
		}
		modifier = {
			add = 2
			NOT = {
				any_relation = {
					type = guardian
				}
			}
			court_owner.court_position:court_tutor_court_position ?= {
				OR = {
					has_trait = vengeful
					has_trait = chaste
					has_trait = stubborn
				}
			}
		}
		modifier = {
			add = 5
			culture = {
				has_cultural_parameter = vengeful_trait_more_common
			}
			NOR = {
				has_trait = vengeful
				has_trait = forgiving
			}
		}
		modifier = {
			add = 5
			culture = {
				has_cultural_parameter = stubborn_trait_more_common
			}
			NOR = {
				has_trait = stubborn
				has_trait = fickle
			}
		}
	}

	immediate = {
		save_scope_as = child
		if = {
			limit = {
				any_relation = {
					type = crush
					is_available_child_allow_travel = yes
				}
				NOT = { #Not a crush who crushes on you!
					any_relation = {
						type = crush
						is_available_child_allow_travel = yes
						any_relation = {
							type = crush
							this = root
						}
					}
				}
			}
			random_relation = {
				type = crush
				limit = {
					is_available_child_allow_travel = yes
					NOT = {
						any_relation = {
							type = crush
							this = root
						}
					}
				}
				save_scope_as = crush
			}
		}
		else = {
			every_vassal = {
				limit = {
					save_good_crush_character_trigger_check = yes
				}
				add_to_list = crushes
			}
			every_vassal = {
				every_child = {
					limit = {
						save_good_crush_character_trigger_check = yes
					}
					add_to_list = crushes
				}
			}
			every_courtier_or_guest = {
				limit = {
					save_good_crush_character_trigger_check = yes
				}
				add_to_list = crushes
			}
			if = {
				limit = {
					top_liege != this
					liege ?= {
						save_good_crush_character_trigger_check = yes
					}
				}
				liege = {
					add_to_list = crushes
				}
			}
			if = {
				limit = {
					top_liege != this
					liege ?= {
						any_vassal = {
							save_good_crush_character_trigger_check = yes
						}
					}
				}
				liege = {
					every_vassal = {
						limit = {
							save_good_crush_character_trigger_check = yes
						}
						add_to_list = crushes
					}
				}
			}
			if = {
				limit = {
					top_liege != this
					liege ?= {
						any_vassal = {
							any_child = {
								save_good_crush_character_trigger_check = yes
							}
						}
					}
				}
				liege = {
					every_vassal = {
						every_child = {
							limit = {
								save_good_crush_character_trigger_check = yes
							}
							add_to_list = crushes
						}
					}
				}
			}
			if = {
				limit = {
					top_liege != this
					liege ?= {
						any_courtier_or_guest = {
							save_good_crush_character_trigger_check = yes
						}
					}
				}
				liege = {
					every_courtier_or_guest = {
						limit = {
							save_good_crush_character_trigger_check = yes
						}
						add_to_list = crushes
					}
				}
			}
			
			random_in_list = {
				list = crushes
				weight = {
					base = 1
					modifier = {
						add = 10
						top_liege != this
						exists = liege
						is_primary_heir_of = liege
					}
					modifier = {
						add = 5
						top_liege != this
						exists = liege
						is_heir_of = liege
					}
					modifier = {
						add = 10
						any_parent = {
							is_powerful_vassal_of = root
						}
					}
					modifier = {
						add = 5
						any_parent = {
							is_vassal_of = root
						}
					}
					modifier = {
						add = 10
						is_of_major_interest_to_root_trigger = yes
					}
					modifier = {
						add = 5
						is_of_minor_interest_to_root_trigger = yes
					}
				}
				save_scope_as = crush
			}
		}
		if = {
			limit = {
				exists = scope:crush
				NOT = { has_relation_crush = scope:crush }
			}
			set_relation_crush = scope:crush
		}
		if = {
			limit = {
				NOT = {
					exists = scope:crush
				}
			}
			pick_servant_romance_target_effect = yes
		}
	}

	option = { #Vengeful
		name = {
			text = child_personality.0006.a
		}
		name = {
			trigger = { exists = scope:crush }
			text = child_personality.0006.a_crush
		}
		trigger = {
			NOR = {
				has_trait = vengeful
				has_trait = forgiving
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				guardian_or_court_tutor_trait = { TRAIT = vengeful }
			}
			modifier = {
				add = -0.5
				guardian_or_court_tutor_trait = { TRAIT = forgiving }
			}
			modifier = {
				add = 100
				culture = {
					has_cultural_parameter = vengeful_trait_more_common
				}
			}
		}
		if = {
			limit = {
				exists = scope:crush
			}
			remove_relation_crush = scope:crush
			if = {
				limit = {
					can_set_relation_victim_trigger = { CHARACTER = scope:crush }
				}
				set_relation_victim = scope:crush
			}
		}
		add_trait = vengeful
		if = {
			limit = {
				is_ai = yes
				exists = scope:crush
			}
			guardian_or_court_tutor_trigger_event = { EVENT = child_personality.1061 }
		}
	}

	option = { #Chaste
		name = child_personality.0006.b
		trigger = {
			NOR = {
				has_trait = chaste
				has_trait = lustful
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				guardian_or_court_tutor_trait = { TRAIT = chaste }
			}
			modifier = {
				add = -0.5
				guardian_or_court_tutor_trait = { TRAIT = lustful }
			}
			modifier = {	#court.6050
				add = 50
				OR = {
					any_parent = { has_character_flag = burned_indecent_books }
					warden ?= { has_character_flag = burned_indecent_books }
					any_relation = {
						type = guardian
						exists = this
						has_character_flag = burned_indecent_books
					}
					AND = {
						liege ?= { has_character_flag = burned_indecent_books }
						location = liege.location
					}
				}
			}
		}
		if = {
			limit = {
				exists = scope:crush
			}
			remove_relation_crush = scope:crush
		}
		add_trait = chaste
		if = {
			limit = {
				is_ai = yes
				exists = scope:crush
			}
			guardian_or_court_tutor_trigger_event = { EVENT = child_personality.1062 }
		}	
	}

	option = { #Stubborn
		name = {
			text = child_personality.0006.c
		}
		name = {
			trigger = { exists = scope:crush }
			text = child_personality.0006.c_crush
		}
		trigger = {
			NOR = {
				has_trait = stubborn
				has_trait = fickle
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				guardian_or_court_tutor_trait = { TRAIT = stubborn }
			}
			modifier = {
				add = -0.5
				guardian_or_court_tutor_trait = { TRAIT = fickle }
			}
			modifier = {
				add = 100
				culture = {
					has_cultural_parameter = stubborn_trait_more_common
				}
			}
		}
		add_trait = stubborn
		if = {
			limit = {
				is_ai = yes
				exists = scope:crush
			}
			guardian_or_court_tutor_trigger_event = { EVENT = child_personality.1063 }
		}
		if = {
			limit = {
				exists = scope:crush
			}
			scope:crush = {
				trigger_event = child_personality.2005
			}
		}
	}
}

#greedy, gregarious or lustful
child_personality_ua.0008 = {
	type = character_event
	title = child_personality.0008.t
	desc = {
		desc = child_personality.0008.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:boy
				}
				desc = child_personality.0008.servant_boy
			}
			triggered_desc = {
				trigger = {
					exists = scope:girl
				}
				desc = child_personality.0008.serving_wench
			}
			desc = child_personality.0008.desc_not_server
		}
	}
	theme = education
	override_background = {
		reference = feast
	}
	left_portrait = {
		character = root
		animation = ecstasy
	}
	right_portrait = {
		character = scope:peasant_server
		animation = admiration
	}

	trigger = {
		is_available_child_allow_travel = yes
		age >= 10 #Because chaste/lustful are only given at age 13
		NOT = {
			has_sexuality = none
		}
		NAND = {
			OR = {
				has_trait = greedy
				has_trait = generous
			}
			OR = {
				has_trait = gregarious
				has_trait = shy
			}
			OR = {
				has_trait = lustful
				has_trait = chaste
				has_sexuality = asexual
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 2
			any_relation = {
				type = guardian
				OR = {
					has_trait = greedy
					has_trait = gregarious
					has_trait = lustful
				}
			}
		}
		modifier = {
			add = 2
			NOT = {
				any_relation = {
					type = guardian
				}
			}
			court_owner.court_position:court_tutor_court_position ?= {
				OR = {
					has_trait = greedy
					has_trait = gregarious
					has_trait = lustful
				}
			}
		}
		modifier = {
			factor = 0.5
			culture = { has_cultural_parameter = lustful_trait_less_common }
		}
	}

	immediate = {
		save_scope_as = child
		hidden_effect = {
			if = {
				limit = {
					NOR = {
						has_sexuality = asexual
						has_trait = lustful
						has_trait = chaste
					}
				}
				add_character_flag = {
					flag = become_lustful
				}
			}
			if = {
				limit = {
					has_character_flag = become_lustful
					OR = {
						AND = {
							has_sexuality = homosexual
							is_female = no
						}
						AND = {
							is_female = yes
							has_sexuality = heterosexual
						}
					}
				}
				save_scope_value_as = {
					name = boy
					value = yes
				}
			}
			else_if = {
				limit = {
					has_character_flag = become_lustful
					OR = {
						AND = {
							has_sexuality = homosexual
							is_female = yes
						}
						AND = {
							is_female = no
							has_sexuality = heterosexual
						}
					}
				}
				save_scope_value_as = {
					name = girl
					value = yes
				}
			}
			else_if = {
				limit = {
					has_sexuality = bisexual
					has_character_flag = become_lustful
				}
				random_list = {
					10 = {
						save_scope_value_as = {
							name = boy
							value = yes
						}
					}
					10 = {
						save_scope_value_as = {
							name = girl
							value = yes
						}
					}
				}
			}
			
			if = { # Generate a crush, for fun
				limit = {
					is_ai = no # Avoid character bloat
					OR = {
						exists = scope:boy
						exists = scope:girl
					}
				}
				hidden_effect = {
					create_character = {
						location = root.capital_province
						template = servant_character
						age = root.age
						gender_female_chance = root_attraction_based_female_chance
						faith = root.capital_province.county.faith
						culture = root.capital_province.county.culture
						dynasty = none
						save_scope_as = peasant_server
					}
					add_courtier = scope:peasant_server
					scope:peasant_server = {
						add_character_flag = peasant_outfit
						set_relation_crush = root
					}
					random_list = {
						25 = {
							trigger = {
								is_female = yes
								scope:peasant_server = { is_female = yes }
							}
							scope:peasant_server = { set_sexuality = homosexual }
						}
						100 = {
							trigger = {
								is_female = yes
								scope:peasant_server = { is_male = yes }
							}
							scope:peasant_server = { set_sexuality = heterosexual }
						}
						25 = {
							trigger = {
								is_male = yes
								scope:peasant_server = { is_male = yes }
							}
							scope:peasant_server = { set_sexuality = homosexual }
						}
						100 = {
							trigger = {
								is_male = yes
								scope:peasant_server = { is_female = yes }
							}
							scope:peasant_server = { set_sexuality = heterosexual }
						}
						50 = {
							scope:peasant_server = { set_sexuality = bisexual }
						}
					}
				}
			}
		}
	}

	option = {
		name = child_personality.0008.a
		trigger = {
			NOR = {
				has_trait = greedy
				has_trait = generous
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				guardian_or_court_tutor_trait = { TRAIT = greedy }
			}
			modifier = {
				add = -0.5
				guardian_or_court_tutor_trait = { TRAIT = generous }
			}
		}
		add_trait = greedy
		if = {
			limit = {
				is_ai = yes
			}
			guardian_or_court_tutor_trigger_event = { EVENT = child_personality.1081 }
		}	
	}

	option = {
		name = child_personality.0008.b
		trigger = {
			NOR = {
				has_trait = gregarious
				has_trait = shy
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				guardian_or_court_tutor_trait = { TRAIT = gregarious }
			}
			modifier = {
				add = -0.5
				guardian_or_court_tutor_trait = { TRAIT = shy }
			}
		}
		add_trait = gregarious
		if = {
			limit = {
				is_ai = yes
			}
			guardian_or_court_tutor_trigger_event = { EVENT = child_personality.1082 }
		}	
	}

	option = {
		name = child_personality.0008.c
		trigger = {
			has_character_flag = become_lustful
			NOR = {
				has_trait = lustful
				has_trait = chaste
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				guardian_or_court_tutor_trait = { TRAIT = lustful }
			}
			modifier = {
				add = -0.5
				guardian_or_court_tutor_trait = { TRAIT = chaste }
			}
			modifier = {	#court.6050
				add = 5
				OR = {
					any_parent = { has_character_flag = supported_indecent_books }
					warden ?= { has_character_flag = supported_indecent_books }
					any_relation = {
						type = guardian
						exists = this
						has_character_flag = supported_indecent_books
					}
					AND = {
						liege ?= { has_character_flag = supported_indecent_books }
						location = liege.location
					}
				}
			}
		}
		add_trait = lustful
		if = {
			limit = {
				exists = scope:peasant_server
			}
			set_relation_crush = scope:peasant_server
		}
		if = {
			limit = {
				is_ai = yes
			}
			guardian_or_court_tutor_trigger_event = { EVENT = child_personality.1083 }
		}	
	}


	after = {
		if = {
			limit = {
				has_character_flag = become_lustful
			}
			remove_character_flag = become_lustful
		}
	}
}

#####
# PERSONALITY GAIN IN PRISON
#####

#Gain lustful
child_personality_ua.0021 = {
	type = character_event
	title = child_personality.0021.t
	desc = {
		desc = child_personality.0021.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:boy
				}
				desc = child_personality.0021.servant_boy
			}
			triggered_desc = {
				trigger = {
					exists = scope:girl
				}
				desc = child_personality.0021.serving_wench
			}
			desc = child_personality.0021.desc_no_gender
		}
	}
	theme = education
	override_background = {
		trigger = { is_in_prison_type = house_arrest }
		reference = sitting_room
	}
	override_background = {
		trigger = { is_in_prison_type = dungeon }
		reference = dungeon
	}
	left_portrait = {
		character = root
		animation = flirtation
	}

	trigger = {
		is_imprisoned = yes
		age >= 10 #Because chaste/lustful are only given at age 13
		NOR = {
			has_trait = lustful
			has_trait = chaste
		}
		NOT = { has_trait = incapable }
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = -0.5
			has_sexuality = asexual
		}
		modifier = {	#court.6050
			add = 5
			imprisoner ?= { has_character_flag = supported_indecent_books }
		}
	}

	immediate = {
		hidden_effect = {
			if = {
				limit = {
					has_sexuality = none
				}
				random_list = {
					0 = { #Heterosexual
						modifier = {
							add = heterosexuality_chance
						}
						save_scope_value_as = {
							name = heterosexual
							value = yes
						}
					}
					0 = { #Homosexual
						modifier = {
							add = homosexuality_chance
						}
						save_scope_value_as = {
							name = homosexual
							value = yes
						}
					}
					0 = { #Bisexual
						modifier = {
							add = bisexuality_chance
						}
						save_scope_value_as = {
							name = bisexual
							value = yes
						}
					}
					0 = { #Asexual
						modifier = {
							add = asexuality_chance
						}
						save_scope_value_as = {
							name = asexual
							value = yes
						}
					}
				}
			}
		}
		#To give tooltip
		if = {
			limit = {
				exists = scope:heterosexual
			}
			set_sexuality = heterosexual
		}
		else_if = {
			limit = {
				exists = scope:homosexual
			}
			set_sexuality = homosexual
		}
		else_if = {
			limit = {
				exists = scope:bisexual
			}
			set_sexuality = bisexual
		}
		else_if = {
			limit = {
				exists = scope:asexual
			}
			set_sexuality = asexual
		}
		hidden_effect = {
			if = {
				limit = {
					OR = {
						AND = {
							has_sexuality = homosexual
							is_female = no
						}
						AND = {
							is_female = yes
							has_sexuality = heterosexual
						}
					}
				}
				save_scope_value_as = {
					name = boy
					value = yes
				}
			}
			else_if = {
				limit = {
					OR = {
						AND = {
							has_sexuality = homosexual
							is_female = yes
						}
						AND = {
							is_female = no
							has_sexuality = heterosexual
						}
					}
				}
				save_scope_value_as = {
					name = girl
					value = yes
				}
			}
		}
	}

	option = {
		name = child_personality.0021.a
		add_trait = lustful
	}
}

#Gain chaste
child_personality_ua.0022 = {
	type = character_event
	title = child_personality.0021.t
	desc = child_personality.0022.desc
	theme = education
	override_background = {
		trigger = { is_in_prison_type = house_arrest }
		reference = sitting_room
	}
	override_background = {
		trigger = { is_in_prison_type = dungeon }
		reference = dungeon
	}
	left_portrait = {
		character = root
		animation = dismissal
	}

	trigger = {
		is_imprisoned = yes
		age >= 10 #Because chaste/lustful are only given at age 13
		NOR = {
			has_trait = chaste
			has_trait = lustful
		}
		NOT = { has_trait = incapable }
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 0.5
			has_sexuality = asexual
		}
		modifier = {	#court.6050
			add = 5
			imprisoner ?= { has_character_flag = burned_indecent_books }
		}
	}

	option = {
		name = child_personality.0022.a
		add_trait = chaste
	}
}

#lustful, chaste
#Child hides in wardrobe, sees two adults having sex
child_personality_ua.7040 = {
	type = character_event
	title = child_personality.7040.t
	desc = {
		desc = child_personality.7040.desc
		first_valid = {
			triggered_desc = {
			    trigger = {
					scope:lover_1 = {
						is_parent_of = root
					}
					scope:lover_2 = {
						is_parent_of = root
					}
			    }
			    desc = {
			    	desc = child_personality.7040.desc_motherfather
			    }
			}
			triggered_desc = {
			    trigger = {
					OR = {
						father ?= scope:lover_1
						father ?= scope:lover_2
					}
			    }
			    desc = {
			    	desc = child_personality.7040.desc_father
			    }
			}
			triggered_desc = {
			    trigger = {
					OR = {
						mother ?= scope:lover_1
						mother ?= scope:lover_2
					}
			    }
			    desc = {
			    	desc = child_personality.7040.desc_mother
			    }
			}
			triggered_desc = {
			    trigger = {
					NOR = {
						scope:lover_1 = {
							is_parent_of = root
						}
						scope:lover_2 = {
							is_parent_of = root
						}
					}
			    }
			    desc = {
			    	desc = child_personality.7040.desc_default
			    }
			}
		}
	}
	theme = education
	override_background = { reference = bedchamber }
	left_portrait = {
		character = scope:lover_1
		animation = admiration
	}
	right_portrait = {
		character = scope:lover_2
		animation = flirtation
	}

	trigger = {
		is_available_child_allow_travel = yes
		age >= 10 #Because chaste/lustful are only given at age 13
		NOR = {
			has_trait = chaste
			has_trait = lustful
		}
		location.county.holder ?= {
			OR = {
				AND = {
					is_ai = yes
					root = {
						is_ai = yes
						any_relation = {
							type = guardian
							is_ai = yes
						}
					}
				}
				appropriate_traumatizing_lover_target = yes
				any_courtier_or_guest = {
					appropriate_traumatizing_lover_target = yes
				}
				any_vassal = {
					appropriate_traumatizing_lover_target = yes
				}
				liege ?= {
						appropriate_traumatizing_lover_target = yes
					}
				AND = {
					liege ?= {
						any_courtier_or_guest = {
							appropriate_traumatizing_lover_target = yes
						}
					}
				}
			}
		}
		is_valid_for_east_asian_events_trigger = no
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 2
			any_relation = {
				type = guardian
				OR = {
					has_trait = lustful
					has_trait = chaste
				}
			}
		}
		modifier = {
			factor = 0.5
			culture = {
				has_cultural_parameter = lustful_trait_less_common
			}
		}
	}

	immediate = {
		save_scope_as = child
		if = { # The AI doesn't need any special flavor for this event
			limit = {
				AND = {
					is_ai = yes
					root = {
						is_ai = yes
						any_relation = {
							type = guardian
							is_ai = yes
						}
					}
				}
			}
			save_scope_as = lover_1
			save_scope_as = lover_2
		}
		else = {
			location.county.holder = {
				if = {
					limit = {
						appropriate_traumatizing_lover_target = yes
					}
					add_to_list = potential_child_traumatizers
				}
				every_courtier_or_guest = {
					limit = {
						appropriate_traumatizing_lover_target = yes
					}
					add_to_list = potential_child_traumatizers
				}
				every_vassal = {
					limit = {
						appropriate_traumatizing_lover_target = yes
					}
					add_to_list = potential_child_traumatizers
				}
				if = {
					limit = {
						liege ?= {
							appropriate_traumatizing_lover_target = yes
						}
					}
					liege = {
						add_to_list = potential_child_traumatizers
					}
				}
				if = {
					limit = {
						exists = liege
					}
					liege = {
						if = {
							limit = {
								appropriate_traumatizing_lover_target = yes
							}
							add_to_list = potential_child_traumatizers
						}
						every_courtier_or_guest = {
							limit = {
								appropriate_traumatizing_lover_target = yes
							}
							add_to_list = potential_child_traumatizers
						}
						every_vassal = {
							limit = {
								appropriate_traumatizing_lover_target = yes
							}
							add_to_list = potential_child_traumatizers
						}
					}
				}
			}
			random_in_list = {
				list = potential_child_traumatizers
				limit = {
					any_secret = {
						type = secret_lover
						NOT = { is_known_by = root }
						secret_target = {
							is_available_ai_adult = yes
						}
					}
				}
				alternative_limit = {
					always = yes
				}
				weight = {
					base = 1
					modifier = {
						add = 10
						is_of_major_interest_to_root_trigger = yes
					}
					modifier = {
						add = 5
						is_of_minor_interest_to_root_trigger = yes
					}
					modifier = {
						add = 10
						has_trait = lustful
					}
					modifier = {
						add = 10
						exists = location
						exists = root.location
						location = root.location
					}
				}
				save_scope_as = lover_1
				if = {
					limit = {
						any_secret = {
							type = secret_lover
							NOT = { is_known_by = root }
							secret_target = {
								is_available_ai_adult = yes
							}
						}
					}
					random_secret = {
						type = secret_lover
						limit = {
							secret_target = {
								is_available_ai_adult = yes
							}
						}
						secret_target = {
							save_scope_as = lover_2
						}
						reveal_to = root
					}
				}
				else = {
					random_relation = {
						type = lover
						save_scope_as = lover_2
					}
				}
			}
		}
		if = {
			limit = {
				OR = {
					has_sexuality = heterosexual
					has_sexuality = bisexual
				}
			}
			if = {
				limit = {
					is_attracted_to_gender_of = scope:lover_1
					scope:lover_1 = {
						is_attracted_to_gender_of = root
					}
				}
				scope:lover_1 = {
					save_scope_as = child_crush_target
				}
			}
			else_if = {
				limit = {
					is_attracted_to_gender_of = scope:lover_2
					scope:lover_2 = {
						is_attracted_to_gender_of = root
					}
				}
				scope:lover_2 = {
					save_scope_as = child_crush_target
				}
			}
		}
		scope:lover_1 = {
			add_character_flag = is_naked
		}
		scope:lover_2 = {
			add_character_flag = is_naked
		}
	}

	option = { # lustful + crush
		name = child_personality.7040.a.crush_version
		trigger = {
			exists = scope:child_crush_target
			NOT = {
				has_relation_crush = scope:child_crush_target
			}
		}
		add_trait = lustful
		if = {
			limit = {
				scope:child_crush_target != root
			}
			set_relation_crush = scope:child_crush_target
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = lustful
			random_relation = {
				type = guardian
				trigger_event = child_personality.7041
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				any_relation = {
					type = guardian
					has_trait = lustful
				}
			}
			modifier = {
				add = -0.5
				any_relation = {
					type = guardian
					has_trait = chaste
				}
			}
		}
	}

	option = { # lustful
		name = child_personality.7040.a
		trigger = {
			OR = {
				is_ai = no
				NOT = { exists = scope:child_crush_target }
			}
		}
		add_trait = lustful
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = lustful
			random_relation = {
				type = guardian
				trigger_event = child_personality.7041
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				any_relation = {
					type = guardian
					has_trait = lustful
				}
			}
			modifier = {
				add = -0.5
				any_relation = {
					type = guardian
					has_trait = chaste
				}
			}
		}
	}

	option = { # chaste
		name = child_personality.7040.b
		add_trait = chaste
		if = {
			limit = {
				is_ai = yes
			}
			add_character_flag = chaste
			random_relation = {
				type = guardian
				trigger_event = child_personality.7041
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				any_relation = {
					type = guardian
					has_trait = chaste
				}
			}
			modifier = {
				add = -0.5
				any_relation = {
					type = guardian
					has_trait = lustful
				}
			}
		}
	}
	after = {
		scope:lover_1 = {
			remove_character_flag = is_naked
		}
		scope:lover_2 = {
			remove_character_flag = is_naked
		}
	}
}